<?  layout("../layout/default.html") { ?>
<div class="admin-panel">
	<div class="tab">
		<div class="tab-head">
			<strong><? if(@data.isNew()){ ?>添加<? }else{ ?>编辑<?} ?></strong>
			<span class="tab-more"><a href="javascript:history.go(-1)" class="button  button-little bg-blue  icon-step-backward"> 返回</a></span>
			<ul class="tab-nav">
			  <li class="active"><a href="#tab-set">信息</a></li>
			</ul>
		</div>
		<div class="tab-body">
		<script type="text/javascript">
		 function check(){
		   var reg =  /^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/; 
		   var reg1 = /^\d{1,6}$/; 
		   var str1 = document.getElementById("netcontroller_ip_address").value;
		   var str2 = document.getElementById("netcontroller_port").value;
		   var str3 = document.getElementById("netcontroller_main").value;
		   var str2int = parseInt(str2);
		   if(!str1.match(reg)){
			   alert("对不起，请输入正确IP地址");
			   document.getElementById("netcontroller_ip_address").value="";
			   return false;
		   }
		   if(!str2.match(reg1) && str2int>65535 ){
			   alert("请输入正确的端口号0-65535");
			   document.getElementById("netcontroller_port").value="";
			   return false;
		   }
		   
		 }
		</script>
			<div class="tab-panel active" id="tab-set">
				<form method="post" class="form-x" action="">
					<div class="form-group">
						<div class="label"><label for="sitename">IP地址</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_ip_address" name="netcontroller.ip_address" size="200" placeholder="请填写IP地址" data-validate="required:请填写IP地址,ip:请填IP" value="${data.ip_address!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">端口</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_port" name="netcontroller.port" size="200" placeholder="请填写端口" data-validate="required:请填写端口,number:请填写数字" value="${data.port!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">main</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_main" name="netcontroller.main" size="200" placeholder="请填写main" data-validate="required:请填写main" value="${data.main!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">地址</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_address" name="netcontroller.address" size="200" placeholder="请填写地址" data-validate="required:请填写地址" value="${data.address!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">域名</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_domain" name="netcontroller.domain" size="200" placeholder="请填写域名" data-validate="required:请填写域名" value="${data.domain!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">net_select</label></div>
						<div class="field">
						<input type="text" class="input" id="netcontroller_net_select" name="netcontroller.net_select" size="200" placeholder="请填写net_select" data-validate="required:请填写net_select" value="${data.net_select!""}"/>
						</div>
					</div>
				<div class="form-button"><button class="button bg-main" type="submit"  onclick="return check()">提交</button></div>
			    </form>
			</div>
		</div>
	</div>
</div>
<?  } ?>			